import {ref, computed} from "vue";
import {defineStore} from "pinia";

export const useShipStore = defineStore(
    "shipSessionStore",
    () => {
        const ship_id = ref("");
        const ship_name = ref("");
        const port_of_registry = ref("");
        const ship_type = ref("");
        const tonnage = ref(0);
        const total_power = ref(0);

        return {
            ship_id,
            ship_name,
            port_of_registry,
            ship_type,
            tonnage,
            total_power
        };
    },
    {
        persist: {
            enabled: true,
            storage: sessionStorage, //自定义存储位置
        },
    }
);
